Extension::MongoDBListDatabases Method

Syntax

.ListDatabases as c ()

Description

Get top level database list.

dim mongo as extension::MongoDB = extension::MongoDB::Create("mongodb://localhost:27017")

dim databasesJson as c = mongo.ListDatabases()
dim def as p = json_parse(databasesJson)

? def.databases[1]
= empty = .F.
name = "TestDatabase"
sizeOnDisk = 73728

The Databases are listed in the database array of a JSON object, which you can deserialize to work with.